package salary.calculation.common.enumerate;

import salary.calculation.common.BusinessExceptionAssert;

public enum CommonResponseEnum implements BusinessExceptionAssert {
    /**
     * success
     */
    SUCCESS(1, "成功"),

    /**
     * 登录超时
     */
    TOKEN_EXPIRED(2, "登录超时，请重新登录"),
    NOT_LOGGED_IN(2, "请先登录"),

    LOGIN_ERROR(3,"登录错误"),
    DECODE_ERROR(4,"解密错误"),
    NOT_PERMISSION(5,"无权限"),

    USER_ROLE_NOT_EXIST(9,"用户角色不存在"),
    USER_NOT_EXIST(10,"用户不存在"),
    USER_OR_PWD_ERROR(11,"用户或密码错误"),
    USER_NAME_IS_EXIST(12,"用户名称已经存在"),
    ACCOUNT_NAME_IS_EXIST(13,"登录名称已经存在"),
    ROLE_NAME_IS_EXIST(14,"角色名称已经存在"),
    OWN_ORG_DEL_ERROR(15,"自身所属机构不能删除"),
    ORG_HAS_ROLE_DEL_ERROR(16,"该机构存在角色，不能删除"),
    ORG_HAS_USER_DEL_ERROR(17,"该机构存在用户,不允许删除"),
    ORG_HAS_ORG_DEL_ERROR(17,"该机构有下级机构,不允许删除"),
    ORG_HAS_STU_DEL_ERROR(18,"该学校拥有学生,不允许删除"),
    ORG_IS_SCHOOL_ADD_ERROR(19,"学校不能再创建机构"),
    ORG_ADD_ORG_ERROR(20,"教育局不能再创建教育局"),

    /**
     * 短信发送
     */
    SMS_SEND_FAIL(50,"短信发送失败"),
    SMS_SEND_ONE_DAY_ERROR(52,"验证码超出当日发送上限"),
    SMS_HAS_BEEN_SEND(53,"验证码已发送"),
    MOBILE_ERROR(54,"手机号输入有误"),
    CODE_ERROR(55,"验证码错误"),

    /**
     * 服务器错误
     */
    SERVER_ERROR(1001, "服务器错误"),
    DATABASE_ERROR(1002, "数据库错误"),
    NULL_POINTER_ERROR(1003, "数据异常"),
    PARSING_ERROR(1004, "解析错误"),
    PATH_NOT_FOUND(1005, "路径不存在"),

    /**
     * 密码错误
     */
    ENCRYPTION_ERROR(1101, "加密错误"),
    DECRYPTION_ERROR(1102, "解密错误"),
    ACCOUNT_ERROR(1103, "账号或密码错误"),
    READ_EXCEL_ERROR(1104,"读取excel文件失败"),
    EXCEL_ERROR(1105,"上传文件只支持xls和xlsx文件后缀"),
    EXCEL_TEMPLATE_ERROR (1106,"excel模板错误"),
    EXCEL_PHONE_EXIST(1107,"excel中拥有相同的手机号码"),
    UPDATE_ERROR(1201, "更新失败"),
    INSERT_ERROR(1202, "新增失败"),
    DELETE_ERROR(1203, "删除失败"),
    UPLOAD_ERROR(1204, "上传失败"),
    DATA_NOT_EXIST(1205, "数据不存在"),
    DATA_EXIST(1206, "数据已存在"),
    PAIRING_ERROR(1207, "配对错误"),
    UNPAIRING_ERROR(1209, "取消配对错误"),
    UNPAIRED_ERROR(1210, "该学生未配对设备"),
    DATA_INVALID(1211,"不存在有效数据"),
    DEVICE_CONFIG_NOT_EXIST(1212,"设备配置不存在，无法计算靶心率以同步数据"),
    TEACHER_PERMISSION_DENIED(1213,"您还没有教师权限，请联系管理员"),
    UNBOUND_CLASS(1214,"您未绑定班级，请联系管理员"),

    DATE_ERROR_30(1301,"所选时间不能大于一个月"),
    CLASS_NO_STUDENTS(1302,"所选班级没有学生"),
    CLASS_DATA_EXIST(1303,"该班级已存在，请选择其他班级"),
    TEACHER_ROLE_NOT_EXIST(1304,"很抱歉，您还没有教师身份，目前无法切换"),


    CLASS_EXIST(1401,"该班级已存在"),
    PHONE_EXIST(1402,"手机号码已存在"),
    ACCOUNT_EXIST(1403,"账号已存在"),
    PHONE_NOT_NULL(1404,"手机号不能为空"),
    WEIGHT_NOT_NULL(1405,"体重不能为空"),
    HEIGHT_NOT_NULL(1406,"身高不能为空"),
    BFR_NOT_NULL(1407,"体脂率不能为空"),
    BASICS_HEARTRATE_NOT_NULL(1408,"基础心率不能为空"),
    RUNNING_SCORD_NOT_NULL(1408,"跑步成绩不能为空"),
    PHONE_NOT_BIND_STUDENT(1409,"该手机号未绑定学生"),
    RUNNING_SCORD_ERROR(1410,"跑步成绩格式错误"),
    PHONE_HAS_BIND_STUDENT(1411,"该手机号已绑定学生"),
    SCHOOL_GRADE_CLASS_NOT_FOUND(1412,"学校班级年级不存在"),
    JUMP_NUM_NOT_NULL(1413,"跳绳个数不能为空"),
    DURATION_NOT_FOUND(1414,"计时时间不能为空"),


    IMPORT_STUDENT_ERROR(1501,"导入学生失败"),
    IMPORT_STUDENT_CONSTITUTION_ERROR(1502,"导入学生体质数据失败"),
    IMPORT_STUDENT_CONSTITUTION_SUCCESS(1503,"导入学生体质数据成功"),

    HOMEWORK_CYCLE_TIME_NOT_NULL(1601,"作业重复周期不能为空"),
    WEEK_TIME_NOT_NULL(1602,"作业重复时间不能为空"),
    HOMEWORK_NOT_ALLOW_UPDATE(1603,"进行中的作业不可修改"),
    HOMEWORK_NOT_ALLOW_DELETE(1604,"进行中的作业不可删除"),
    CANT_COMPLETE_FOR_CHANGED_CLASS(1605,"学生更换了班级，无法完成作业"),
    HOMEWORK_NOT_BEGIN(1606,"作业未开始"),
    HOMEWORK_OUT_OF_DATE(1607,"作业已结束"),
    HOMEWORK_CONTENT_COMPLETED(1608,"作业任务已完成，不可重复提交"),
    HOMEWORK_CANT_COMPLETE(1609,"作业未可提交"),
    HOMEWORK_DATE_ERROR(1610,"homeworkDate错误"),
    NOT_SUPPORT_DROP_OUT_SCHOOL(1611, "暂不支持退出学校"),
    NO_SCORE(1612, "没有该成绩的学生"),
    JUMP_CHEATING(1613,"跳绳作弊，数据无效"),
    JUMP_MEDAL_EXIST(1614,"勋章已存在"),

    CLASS_INVITE_NOT_EXIST(1701,"班级邀请码不存在"),
    COURSE_NOT_CONFIG(1702,"缺少课程时间配置"),

    PIC_MAX_ERROR(4001,"最多可上传9张图片")
    ;


    CommonResponseEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    /**
     * 返回码
     */
    private int code;
    /**
     * 返回消息
     */
    private String msg;

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }
}
